//
//  DTKTool.h
//  DTBaseDemo
//
//  Created by 葛悦彣 on 2023/2/14.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "ACMediaPickerManager.h"

NS_ASSUME_NONNULL_BEGIN
@class IQTextView;
@interface DTKTool : NSObject


typedef void(^GYWclickBlock)(void);
typedef void(^textBlock)(NSString * str);


#pragma mark - 圆角

/// 控件圆角
/// - Parameters:
///   - radius: 圆角半径
///   - view: 控件
+ (void)RoundedCornerWith:(CGFloat)radius andView:(UIView *)view;

/// 控件圆角带边框
/// - Parameters:
///   - radius: 圆角半径
///   - view: 控件
///   - width: 边框宽度
///   - color: 颜色
+(void)RoundedCornerWith:(CGFloat)radius andView:(UIView *)view andWidth:(CGFloat)width andColor:(UIColor *)color;




/// 部分圆角
/// - Parameters:
///   - radius: 圆角半径
///   - view: 控件
///   - corner:需要处理的角
///   - rect: 控件的frame
+ (void)PartialRoundedCornerWith:(CGFloat)radius andView:(UIView *)view andCorner:(UIRectCorner)corner andSize:(CGRect )rect;


#pragma mark - 创建控件
+ (UILabel *)labelWithText:(NSString *)text andTextColor:(UIColor *)color andFont:(UIFont *)font;




///倒角工具
+ (void)YJ:(CGFloat)radius andView:(UIView *)view;
///圆角边框
+ (void)YJBK:(CGFloat)radius andView:(UIView *)view andWidth:(CGFloat)width andColor:(UIColor *)color;
///阴影圆角
+ (void)YJYY:(CGFloat)radius andView:(UIView *)view andWidth:(CGFloat)width andColor:(UIColor *)color andSize:(CGSize )size andOpacity:(CGFloat)Opacity;
///部分圆角,需要提供frame
+ (void)BFYJ:(CGFloat)radius andView:(UIView *)view andCorner:(UIRectCorner)corner andSize:(CGRect )rect;

+ (UILabel *)labelWithText:(NSString *)text andFont:(UIFont *)font andTextColor:(UIColor *)color;
///随机字符串纯英文;
+ (NSString *)sjzf:(int)d;
+ (BOOL)isIponeX;
///绘制虚线
+ (void)drawLineOfDashByCAShapeLayer:(UIView *)lineView lineLength:(int)lineLength lineSpacing:(int)lineSpacing lineColor:(UIColor *)lineColor lineDirection:(BOOL)isHorizonal;
///计算文本尺寸
+ (CGSize )textWithtitle:(NSString *)title andSize:(CGSize)size andFout:(UIFont *)fout;
///计算富文本尺寸
+ (CGSize )textWithAttStr:(NSAttributedString *)attStr andSize:(CGSize)size;

///正则富文本
+ (NSMutableAttributedString *)AttributedStringWithStr:(NSString * )str andNodeColor:(UIColor * )nodeColor andSeledColor:(UIColor *)seledColor andFont:(UIFont *)font andPattenr:(NSString *)pattenr ;
+ (NSMutableAttributedString *)AttributedStringWithStr:(NSString * )str andNodeColor:(UIColor * )nodeColor andSeledColor:(UIColor *)seledColor andNodeFont:(UIFont *)Nodefont andFont:(UIFont *)font andPattenr:(NSString *)pattenr ;

+ (IQTextView * )NewTextView;

///判断版本是不是最新
+ (BOOL)VersionJudgment:(NSString *)str;

+ (NSString *)token;
///获取当前控制器
+ (UIViewController *)getCurrentVC;


/// 打开相册或者视频 ACMediaPickerSourceFromAll 选择相册或相机 ACMediaPickerSourceFromAlbum, 打开相册,ACMediaPickerSourceFromCamera   打开相机
/// - Parameters:
///   - type: ACMediaPickerSourceFromAll 选择相册或相机 ACMediaPickerSourceFromAlbum, 打开相册,ACMediaPickerSourceFromCamera   打开相机
///   - block: 回调
+ (ACMediaPickerManager *)openXJWithType:(ACMediaPickerSource)type andLX:(BOOL)lx andBlock:(void(^)(NSArray<ACMediaModel *> * list))block;


/// 简单的加水印需要再设置
+ (UIImage *)watermarkImage:(UIImage *)img withName:(NSString *)name;

///字符串正则判断
+ (BOOL)ZZWithStr:(NSString *)Str andZZ:(NSString *)zzStr;

///判断手机号
+ (BOOL)SJHPDWithStr:(NSString *)Str;

///拨打电话
+ (void)makePhoneCalls:(NSString *)phone;

///取视频第一帧
+ (UIImage *)getVideoFirstViewImage:(NSURL *)path;

///展示视频和图片
+ (void)openImagAndVideo:(NSArray <NSString *>*)urlArray andopenview:( UIView * _Nullable )view andIndex:(int)index;

///字符串转字典
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;
///字典转json字符串
+ (NSString *)convertToJsonData:(NSDictionary *)dict;
///打开登录
+ (void)OpenLogin;
///html去标签
+(NSString *)filterHTML:(NSString *)html;
@end

@interface gywbtn : UIButton
@property (nonatomic ,strong) NSDictionary * infoDict;
@end


@interface DTKNoClickView : UIView

@end
@interface DTKNoClickTableView : UITableView

@end
NS_ASSUME_NONNULL_END
